package hu.veilingsite.client;

import hu.veilingsite.shared.Auction;
import hu.veilingsite.shared.Bid;
import hu.veilingsite.shared.Category;
import hu.veilingsite.shared.ClientUser;

import java.util.ArrayList;
import java.util.Date;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("greet")
public interface Service extends RemoteService {
	boolean login(String user, String pass);
	boolean registreer(String name, String password, String email, String address, String residence, int birthdateday, int birthdatemonth, int birthdateyear);
	ClientUser getUser(String email);
	ClientUser getUser(int user_id);
	boolean updatePassword(String password,String email);
	boolean updateUser(ClientUser user);
	ArrayList<ClientUser> getUsers();
	ArrayList<Auction> getLatestAcutions();
	boolean createBieding(int userID, int auctionID, int offer, Date date);
	ArrayList<Auction> getAllAuctions();
	ArrayList<Auction> getAllAuctionsFromUser(int id);
	boolean createAuction(int ai, int ci, String tt, String dp, int sp,Date ed, int vs);
	boolean updateCategory(Category cat);
	boolean insertCategory(Category cat);
	boolean deleteCategory(int id);
	ArrayList<Category> getCategories();
	Auction getAuction(int id);
	int valCoupon(String coup, ClientUser cu);
	ArrayList<Integer> getYears();
	Bid getHighestBid(String string, int year, int month, int week, int day);
	Category getCategory(int id);
	ArrayList<Auction> getBestBidAuctions();
	void deleteAuction(int id);
	ArrayList<Auction> getAuctionAdmin();
	ArrayList<Bid> getBidsFromUser(int id);
	String getNameOfUser(int userId);
	ArrayList<Bid> getBidsFromAuction(int auctionID);
	void saveAuction(Auction veiling);
	boolean deleteBid(int bidId);
	boolean acceptBid(int bidId) throws Exception;
}
